﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace UpdateBot2.UI
{
    /// <summary>
    /// Interaction logic for InputWindow.xaml
    /// </summary>
    public partial class InputWindow : Window
    {
        //The user input.
        public String Text
        {
            get
            {
                return textBox1.Text;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="promptLabel">The prompt to address to the user.</param>
        /// <param name="actionButtonLabel">The label of the OK button</param>
        /// <param name="initalValue">Initial value of the text input.</param>
        /// <param name="windowTitle">The Title of the window.</param>
        public InputWindow(String promptLabel, String actionButtonLabel, String initalValue, String windowTitle)
        {
            InitializeComponent();
            labelLabel.Content = promptLabel;
            ActionLabel.Text = actionButtonLabel;
            textBox1.Text = initalValue;
            this.Title = windowTitle;

            textBox1.Focus();
        }

        /// <summary>
        /// Fired when OK, or action button is clicked.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void actionButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        /// <summary>
        /// Fired upon the Cancel button being pressed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}
